<?php
class Index extends Controller {
	public function html() {
		$mUser = new User_model();
		$currUser = $mUser->currUser();
		if(!$currUser) header('Location:/auth/login?backurl='.urlencode('/yunying/product/ticket/'));
		
		$id = $this->get('id', 'int');
		if(!$id) header('Location: /yunying/product/ticket/');
		
		//获取景点信息
		$mProduct = new Product_model();
		//获取景点信息
		$data['info'] = $mProduct->productInfo(array('id' => $id));
		$data['product_id'] = $id;
		
		$mTicket = new Ticket_model();
		//获取票信息
		$params = array('product_id' => $id, 'is_deleted' => 0);
		$data['ticket'] = $mTicket->page(1, 20, $params);
		$tpl = 'yunying/product/ticket/index.html';
		
		$this->display($data, $tpl);
	}
}